﻿<h3>TestBootstrapChartDoughnut</h3>
<Chart ChartType="ChartType.Doughnut" OnInitAsync="@OnInit" Height="300px"  />
@code {
    private Random Randomer { get; } = new();

    private int DoughnutDatasetCount = 1;

    private int DoughnutDataCount = 5;

    private Task<ChartDataSource> OnInit()
    {
        var ds = new ChartDataSource();
        ds.Options.Title = "Doughnut Donut Chart";
        ds.Labels = Charts.Utility.Colors.Take(DoughnutDataCount);
        for (var index = 0; index < DoughnutDatasetCount; index++)
        {
            ds.Data.Add(new ChartDataset()
                {
                    Label = $"Set {index}",
                    Data = Enumerable.Range(1, DoughnutDataCount).Select(i => Randomer.Next(20, 37)).Cast<object>()
                });
        }
        return Task.FromResult(ds);
    }

}
